//
//  ZYArrowView.m
//  Beautiful
//
//  Created by admin on 2017/5/12.
//  Copyright © 2017年 admin. All rights reserved.
//

#import "ZYArrowView.h"

@implementation ZYArrowView


// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
    // 1. 获取"图形上下文"
    
    CGContextRef ctx = UIGraphicsGetCurrentContext();
    
    //2.以顺时针的方式画一个大圆
    
    UIBezierPath *path = [UIBezierPath bezierPathWithArcCenter:CGPointMake(150, 150) radius:100 startAngle:0 endAngle:M_PI * 2 clockwise:YES];
    
    // 3.以逆时针画一个小圆
    
    UIBezierPath *path1 = [UIBezierPath bezierPathWithArcCenter:CGPointMake(150, 150) radius:50 startAngle:0 endAngle:M_PI * 2 clockwise:NO];
    
    //4.添加路径到上下文中
    
    CGContextAddPath(ctx, path1.CGPath);
    
    CGContextAddPath(ctx, path.CGPath);
    
    
    
    // 默认填充模式: nonzero winding number rule(非零绕数规则)从左到右跨过, +1。从右到左跨过, -1。最后如果为0, 那么不填充, 否则填充
    
    //渲染
    
    CGContextDrawPath(ctx, kCGPathFill);
    
}


@end
